-
-
Notifications
You must be signed in to change notification settings - Fork 226
[19.0][MIG] sale_financial_risk: Migration to 19.0 #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pablo-cort-s73
wants to merge
62
commits into
OCA:19.0
Choose a base branch
from
Studio73:19.0-mig-sale_financial_risk
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29a9bba to
b4b502b
Compare
Member
|
/ocabot migration sale_financial_risk |
ebba929 to
939adc7
Compare
…invoices) Company currency
Currently translated at 7.7% (1 of 13 strings) Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/fr/
Currently translated at 7.7% (1 of 13 strings) Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt_BR/
Currently translated at 46.2% (6 of 13 strings) Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/it/
Currently translated at 100.0% (13 of 13 strings) Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt_BR/
Currently translated at 23.1% (3 of 13 strings) Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt/
…le_financial_risk: - Optimize code and change stored computed fields to not store to improve multi-company support - Improve multi-currency support - Convert risk amount fields to clickable link that shows traceability of amount origin - New pivot views to risk amount traceability - Simplify class style applied on risk fields - Migration script to remove old stored computed fields - Improve tests to cover new functionallity - Update translation files account_financial_risk: - Don't block refund invoice validation when partner has risk exception - Allow search partners by risk exception field - Remove obsolete cron sale_financial_risk - Create related store commercial_partner_id field in sale order line to simplify computation - Rename amt_to_invoice field to risk_amount in sale order line - Hook and migration scripts to reduce new fields computing time TT23765
…lation if auto done is configured.
Currently translated at 85.0% (17 of 20 strings) Translation: credit-control-15.0/credit-control-15.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-sale_financial_risk/fr/
Currently translated at 25.0% (5 of 20 strings) Translation: credit-control-15.0/credit-control-15.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-sale_financial_risk/it/
Currently translated at 100.0% (20 of 20 strings) Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
res.partner credit_limit field is a commercial field that triggers the children syncronization. In partners with lots of children, those recalculations can lead to a poor user experience when a operation that is replicated over all the children doesn't perform fine. This is the case with the risk_partner_id field, wich relation is recalculated a thus as many queries as children has the contact (it can be dozens). TT43572
Currently translated at 100.0% (21 of 21 strings) Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
…lexibility TT26717 TT31209
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (21 of 21 strings) Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
This issue appeared for multi-company, multi-currency configuration. Whenever risk was calculated for the partner, Sale Order amount was converted to company currency, instead of currency set on the partner. This commit fixes the issue by converting to correct currency (set on the partner).
The test_manual_currency_risk_not_exceeded test that assesses that the manual currency risk has not been passed fails when another module changes the company's currency. The reason for the failure is that if the company currency matches the currency of the sell order it does not convert correctly and in that case it interprets the limit within the same currency. For example, if the company currency is set as EUR and the sales order is placed in EUR, the conversion of the 100€ is not done and therefore exceeds the limit set to 99. To solve this, the company currency is first checked to set a different currency in the order. On the other hand, the tests should be frozen at a certain date to prevent the exchange rate of the exchange currency from going up or down thus avoiding errors when running the test, which should check that it has not been exceeded.
Currently translated at 100.0% (21 of 21 strings) Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/nl/
Currently translated at 100.0% (21 of 21 strings) Translation: credit-control-17.0/credit-control-17.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-sale_financial_risk/it/
…ax amounts. The product product.product_product_2 does not have explicit taxes, but after this commit odoo/odoo@2836416, an error occurs when comparing the expected amount. So, adapt the amount to compare without taxes and create a new product to avoid depending on demo data.
Currently translated at 100.0% (21 of 21 strings) Translation: credit-control-18.0/credit-control-18.0-sale_financial_risk Translate-URL: https://translation.odoo-community.org/projects/credit-control-18-0/credit-control-18-0-sale_financial_risk/tr/
…id errors in tests Use the same method that appears in sale test: https://github.com/odoo/odoo/blob/74eecadb39e0c260f4cfc1ae9478c84eda815132/addons/sale/tests/test_payment_flow.py#L43 Traceback (most recent call last): File "/opt/odoo/auto/addons/sale_financial_risk/tests/test_payment_financial_risk.py", line 70, in test_payment_risk_bypass patched.assert_called_once_with(ANY, sale_order_id=ANY) File "/usr/local/lib/python3.10/unittest/mock.py", line 941, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/usr/local/lib/python3.10/unittest/mock.py", line 929, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: expected call not found. Expected: _compute_show_tokenize_input_mapping(<ANY>, sale_order_id=<ANY>) Actual: _compute_show_tokenize_input_mapping(payment.provider(18,), website_id=1, sale_order_id=91)
When users without accounting access are trying to access a Sale Order, they have an access error on the partner field credit_limit (standard Odoo field that is limited to Account groups), which is used when computing the SO's risk_info. Use sudo across in the financial risk modules when accessing partner.credit_limit.
…e sale financial fields
939adc7 to
e73e402
Compare
e73e402 to
1d19c31
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main changes include: